using System;
using System.Reflection;

namespace Elev.Core.DBUpdates
{
    public enum DBStatus
    {
        Outdated,
        TooNew,
        Synchronized
    }

    /// <summary>
    /// This class is used to keep centralized DB synchornisation with the application
    /// </summary>
    public class DBUpdater
    {
        static public int DB_VERSION_EXPECTED = 1;
        
        int currentVersion = -1;

        public DBStatus GetDBStatus
        {
            get
            {
                if (currentVersion > DBUpdater.DB_VERSION_EXPECTED)
                    return DBStatus.TooNew;

                if (currentVersion < DB_VERSION_EXPECTED)
                    return DBStatus.Outdated;

                return DBStatus.Synchronized;
            }
        }

        public DBUpdater(int CurrentVersion)
        {
            currentVersion = CurrentVersion;
        }
    }
}
